package main

import (
	"bytes"
	"fmt"
	"os/exec"
	"time"
)

func main() {
	var out bytes.Buffer

	//cmdString1 := "/usr/lib/golang/bin/go"
	//cmdString2 := "run"
	cmdString3 := "/home/zxx/src/go/src/git.oschina.net/zd04/golang-learn/20170103/tk"
	cmd := exec.Command(cmdString3)

	cmd.Stdout = &out
	go cmd.Run()
	<-time.After(time.Second * 3)
	fmt.Println(cmd.Process.Pid)
	cmd.Process.Kill()
	fmt.Println(out.String())
}
